package main

import (
	"fmt"
	"math"
)

func getAllYinzi(n int) []int {
	var a = []int{1}
	for i := 2; i <= int(math.Sqrt(float64(n))); i++ {
		if n%i == 0 {
			a = append(a, i)
			res := judgeIsHas(n/i, a)
			if (!res) {
				a = append(a, n/i)
			}
		}
	}
	return a
}

func judgeIsHas(n int, s []int) bool {
	for _, v := range s {
		if (v == n) {
			return true
		}
	}
	return false
}
/*
	一个数如果恰好等于它的因子之和，这个数就称为“完数”。例如6=1＋2＋3.
编程找出1000以内的所有完数
*/
func main() {

	var n int
	fmt.Scanf("%d", &n)

	s := getAllYinzi(n)
	fmt.Println(s)
	var sum = 0
	for _, v := range s {
		sum += v
	}
	if n == sum {
		fmt.Println("true")
	} else {
		fmt.Println("false")
	}
}
